package com.koron.system.org.mapper;

import com.koron.bean.system.org.OrgBean;
import com.koron.bean.system.org.query.OrgQuery;
import com.koron.system.common.util.TypeTreeVo;
import com.koron.system.org.bean.WorkFlowDepartment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName OrgMapper
 * @description
 * @Author zhouj
 * @Date 2021/7/6 11:20
 */
@Mapper
@Component
public interface OrgMapper {


    int insert(OrgBean orgBean);

    int update(OrgBean orgBean);

    int delete(@Param("id") String id);

    int softDelete(@Param("id") String id);

    int deleteOrgList(@Param("ids") List<String> ids);

    List<TypeTreeVo> queryOrgTree(OrgQuery orgQuery);

    List<OrgBean> queryNextOrgList(@Param("orgBean") OrgQuery orgBean);

    Long queryNextOrgListCount(@Param("orgBean") OrgBean orgBean);

    OrgBean querySingleOrg(OrgBean orgBean);

    /**
     * 获取工作流组织
     *
     * @return
     */
    List<WorkFlowDepartment> getWorkFlowDepartmentList();

    OrgBean queryParentLevelPath(@Param("parent") String parent);

    int resetPy(@Param("list") List<OrgBean> listByOrg);

    int updateChildrenLevelPathName(@Param("prePath") String prePath, @Param("pre") String preLevelPathName, @Param("cur") String curLevelPathName);

    OrgBean queryByOrgId(String orgId);

    List<OrgBean> queryByParent(String queryByParent);

    List<OrgBean> queryByOrgIds(@Param("orgIds") List<String> orgIds);

    Integer getSortByName(@Param("name") String name);
}
